#encoding:utf-8
import os
import zipfile

def zipFiles(toZipList,zipfilename):
    filelist =[]
    for obj in toZipList:
        if os.path.isfile(obj):
            filelist.append(obj)
        else:
            for root,dirs,files in os.walk(obj):
                for name in files:
                    filelist.append(os.path.join(root,name))
    zf = zipfile.ZipFile(zipfilename,'w',zipfile.zlib.DEFLATED)
    for fl in filelist:
        zf.write(fl)
    zf.close()
def zipHtmlPage(pageName):
    (dir, name) = os.path.split(pageName)
    
def unzipFile():
    pass
if __name__ =='__main__':
    zipFiles((r'E:\1', ),r'D:\123.zip')
